function generateFamilyForm() {
	var form = "";
	var nr = document.getElementById("nr_persons").value;
	form += "<form action='index.php?action=generateFamilyXML' method='POST'><table>";
	for (i=1;i<=nr;i++) {
		form += '<tr><td>First name:</td><td><input type="text" class="firstName" name="firstName'+i+'"></td></tr>';
		form += '<tr><td>Last name:</td><td><input type="text" class="lastName" name="lastName'+i+'"></td></tr>';
		form += '<tr><td>Age:</td><td><input type="text" class="age" name="age'+i+'"></td></tr>';
		form += '<tr><td>Sex:</td><td><select class="sex" name="sex'+i+'"><option value="male">male</option><option value="female">female</option></select></td></tr>';
		form += '<tr><td>&nbsp;</td></tr>';
	}
	form += "<tr><td><input type='hidden' id='nr_hidden' name='nr_hidden' value='"+nr+"'></td></tr>";
	form += "<tr><td><input type='submit' value='Generate XML' name='generateXML'></td></tr>";
	form += "</table></form>";
	document.getElementById("family_form").innerHTML = form;
}

function generateSensorsForm() {
	var form = "";
	var nr = document.getElementById("nr_sensors").value;
	form += "<form action='index.php?action=generateFamilyXML' method='POST'><table>";
	for (i=1;i<=nr;i++) {
		form += '<tr><td>First name:</td><td><input type="text" class="firstName" name="firstName'+i+'"></td></tr>';
		form += '<tr><td>Last name:</td><td><input type="text" class="lastName" name="lastName'+i+'"></td></tr>';
		form += '<tr><td>Age:</td><td><input type="text" class="age" name="age'+i+'"></td></tr>';
		form += '<tr><td>Sex:</td><td><select class="sex" name="sex'+i+'"><option value="male">male</option><option value="female">female</option></select></td></tr>';
		form += '<tr><td>&nbsp;</td></tr>';
	}
	form += "<tr><td><input type='hidden' id='nr_hidden' name='nr_hidden' value='"+nr+"'></td></tr>";
	form += "<tr><td><input type='submit' value='Generate XML' name='generateXML'></td></tr>";
	form += "</table></form>";
	document.getElementById("family_form").innerHTML = form;
}